package com.kun.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.activiti.api.process.model.ProcessInstance;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.Optional;

@Getter
@Setter
@ToString
@NoArgsConstructor
public class ProcessInstanceVo {

    private String id;

    @NotBlank(message = "流程名称不能为空")
    private String name;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startDate;

    private ProcessInstance.ProcessInstanceStatus status;

    /**
     * 流程定义ID
     */
    private String processDefinitionId;

    @NotBlank(message = "流程定义KEY不能为空")
    private String key;

    private Integer version;

    /**
     * 资源名
     */
    private String resourceName;

    public ProcessInstanceVo(String id, String name, Date startDate, ProcessInstance.ProcessInstanceStatus status,
                             String processDefinitionId, String key, Integer version, String resourceName) {
        this.id = id;
        this.name = name;
        this.startDate = startDate;
        this.status = status;
        this.processDefinitionId = processDefinitionId;
        this.key = key;
        this.version = version;
        this.resourceName = resourceName;
    }
}
